package cool.webstudy.admin.controller.attackrecord;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cool.webstudy.admin.model.dto.attackrecord.PaginationQueryAttackRecordListDTO;
import cool.webstudy.admin.model.dto.competition.PaginationQueryCompetitionInfoListDTO;
import cool.webstudy.admin.model.vo.attackrecord.PaginationQueryAttackRecordListVO;
import cool.webstudy.admin.model.vo.attackrecord.QueryTeamAttackRecordListVO;
import cool.webstudy.admin.model.vo.competition.PaginationQueryCompetitionInfoListVO;
import cool.webstudy.admin.service.AttackRecordService;
import cool.webstudy.admin.utils.aspect.request.RequestParameterCheck;
import cool.webstudy.admin.utils.common.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 莫振双
 * @date 2025/4/18 23:39
 * @description: 攻击记录服务接口
 */
@Tag(name = "攻击记录服务")
@RestController
@RequestMapping("/attack-record")
@RequestParameterCheck
public class AttackRecordController {
    @Autowired
    private AttackRecordService attackRecordService;

    @PostMapping("/page-query/list")
    @Operation(summary = "分页查询攻击记录列表接口")
    public Result<Page<PaginationQueryAttackRecordListVO>> paginationQueryList(@RequestBody PaginationQueryAttackRecordListDTO dto){
        Page<PaginationQueryAttackRecordListVO> vo = attackRecordService.paginationQueryAttackRecordList(dto);
        return Result.success(vo);
    }

    @GetMapping("/team-attack-record-list")
    @Operation(summary = "查询队伍攻击记录列表接口")
    public Result<List<QueryTeamAttackRecordListVO>> queryTeamAttackRecordListByCompUnCode(@RequestParam @Schema(description = "赛事业务主键") String compUnCode){
        List<QueryTeamAttackRecordListVO> vo = attackRecordService.queryTeamAttackRecordListByCompUnCode(compUnCode);
        return Result.success(vo);
    }
}
